from django.shortcuts import render
from django.http import HttpResponse
from . import service
# Create your views here.

def index(request):
    ps = service.poems
    return render(request, "poem/list.html",{"poems":ps})

def detail(request, name):
    for p in service.poems:
        if name == p['name']:
            title = p['title']
            content = p['content']
            break 
    return render(request, 'poem/shige.html', {"title":title, "content":content})
